﻿using Microsoft.Xna.Framework;

namespace Firefly.ExtensionMethods
{
    public static class Vector4Extensions
    {
        public static Vector3 ToVector3(this Vector4 obj)
        {
            return new Vector3(obj.X, obj.Y, obj.Z);
        }

        public static Vector4 Parse(this Vector4 obj, string value)
        {
            string[] split = value.Split(',');

            if (split != null && split.Length == 4)
            {
                return new Vector4(float.Parse(split[0]), float.Parse(split[1]), float.Parse(split[2]), float.Parse(split[3]));
            }

            return Vector4.Zero;
        }
    }
}